<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
<meta name="theme-color" content="#222"><meta name="generator" content="Hexo 7.3.0">


  <link rel="apple-touch-icon" sizes="180x180" href="/favicon.ico">
  <link rel="icon" type="image/png" sizes="32x32" href="/favicon.ico">
  <link rel="icon" type="image/png" sizes="16x16" href="/favicon.ico">
  <link rel="mask-icon" href="/favicon.ico" color="#222">

<link rel="stylesheet" href="/css/main.css">

<link rel="stylesheet" href="https://fonts.loli.net/css?family=Lato:300,300italic,400,400italic,700,700italic%7CZCOOL+QingKe+HuangYou:300,300italic,400,400italic,700,700italic&display=swap&subset=latin,latin-ext">

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css" integrity="sha256-DfWjNxDkM94fVBWx1H5BMMp0Zq7luBlV8QRcSES7s+0=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/3.1.1/animate.min.css" integrity="sha256-PR7ttpcvz8qrF57fur/yAx1qXMFJeJFiA6pSzWi0OIE=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha256-Vzbj7sDDS/woiFS3uNKo8eIuni59rjyNGtXfstRzStA=" crossorigin="anonymous">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/themes/blue/pace-theme-bounce.css">
  <script src="https://cdnjs.cloudflare.com/ajax/libs/pace/1.2.4/pace.min.js" integrity="sha256-gqd7YTjg/BtfqWSwsJOvndl0Bxc8gFImLEkXQT8+qj0=" crossorigin="anonymous"></script>

<script class="next-config" data-name="main" type="application/json">{"hostname":"www.kaaaaai.cn","root":"/","images":"/images","scheme":"Gemini","darkmode":false,"version":"8.12.1","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12},"copycode":{"enable":true,"style":"mac"},"bookmark":{"enable":false,"color":"#222","save":"auto"},"mediumzoom":false,"lazyload":true,"pangu":false,"comments":{"style":"tabs","active":"valine","storage":true,"lazyload":true,"nav":null},"stickytabs":false,"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"fadeInDown","post_body":"fadeInDown","coll_header":"fadeInLeft","sidebar":"fadeInUp"}},"prism":false,"i18n":{"placeholder":"搜索...","empty":"没有找到任何搜索结果：${query}","hits_time":"找到 ${hits} 个搜索结果（用时 ${time} 毫秒）","hits":"找到 ${hits} 个搜索结果"},"path":"/search.xml","localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false}}</script><script src="/js/config.js"></script>

    <meta name="description" content="使用 GitHub 很久，除了无脑 star、fork 大神们的仓库、输出一些学习代码以外，对于 GitHub 本身的贡献似乎寥寥。Arctic Code Vault Contributor 的勋章我受之有愧。如果你也有和我类似的想法，那么，是时候可以尝试一下维护一个自己的开源库了。 维护一个开源库，听起来很简单，但是真正要开始动手，似乎颇有些千头万绪，无从下手。那让我们来捋一捋，首先我们碰到的第">
<meta property="og:type" content="article">
<meta property="og:title" content="是时候维护一个属于自己的开源库了">
<meta property="og:url" content="https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html">
<meta property="og:site_name" content="壹拾肆">
<meta property="og:description" content="使用 GitHub 很久，除了无脑 star、fork 大神们的仓库、输出一些学习代码以外，对于 GitHub 本身的贡献似乎寥寥。Arctic Code Vault Contributor 的勋章我受之有愧。如果你也有和我类似的想法，那么，是时候可以尝试一下维护一个自己的开源库了。 维护一个开源库，听起来很简单，但是真正要开始动手，似乎颇有些千头万绪，无从下手。那让我们来捋一捋，首先我们碰到的第">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://i.loli.net/2020/11/22/IJGh1tVqATzZlYL.jpg">
<meta property="og:image" content="https://i.loli.net/2020/11/22/9FHA4eQsfUqkWYX.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/F39zC7M2nTcXGyP.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/b4ga6fzWIvkVoce.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/ezD8NbqloGFipHX.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/qKgJbv1x2cGzk7e.png">
<meta property="og:image" content="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=%230076D6&style=flat&logo=google-chrome&logoColor=%230076D6">
<meta property="og:image" content="https://i.loli.net/2020/11/22/pcHKt3e9LRv1jdV.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/s6yAmwq84ZRFkoz.png">
<meta property="og:image" content="https://i.loli.net/2020/11/22/Mmc8NQbY4g5Tw3q.png">
<meta property="article:published_time" content="2020-11-21T01:37:05.000Z">
<meta property="article:modified_time" content="2022-07-07T10:32:25.136Z">
<meta property="article:author" content="Kaaaaai">
<meta property="article:tag" content="EXP">
<meta property="article:tag" content="OpenSource">
<meta property="article:tag" content="GitHub">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="https://i.loli.net/2020/11/22/IJGh1tVqATzZlYL.jpg">


<link rel="canonical" href="https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html">



<script class="next-config" data-name="page" type="application/json">{"sidebar":"","isHome":false,"isPost":true,"lang":"zh-CN","comments":true,"permalink":"https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html","path":"/its-time-to-build-an-open-source-library.html","title":"是时候维护一个属于自己的开源库了"}</script>

<script class="next-config" data-name="calendar" type="application/json">""</script>
<title>是时候维护一个属于自己的开源库了 | 壹拾肆</title>
  
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-102185873-1"></script>
  <script class="next-config" data-name="google_analytics" type="application/json">{"tracking_id":"UA-102185873-1","only_pageview":false}</script>
  <script src="/js/third-party/analytics/google-analytics.js"></script>

  <script src="/js/third-party/analytics/baidu-analytics.js"></script>
  <script async src="https://hm.baidu.com/hm.js?9578d14210d67becef48447e4f6b3f20"></script>



<link rel="dns-prefetch" href="https://waline-server-kaaaaai.vercel.app"> <script type="text/javascript" src="/js/link-highlight.js"></script>

  <noscript>
    <link rel="stylesheet" href="/css/noscript.css">
  </noscript>
<link rel="alternate" href="/atom.xml" title="壹拾肆" type="application/atom+xml">
</head>

<body itemscope itemtype="http://schema.org/WebPage" class="use-motion">
  <div class="headband"></div>

  <main class="main">
    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏" role="button">
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
        <span class="toggle-line"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/" class="brand" rel="start">
      <i class="logo-line"></i>
      <p class="site-title">壹拾肆</p>
      <i class="logo-line"></i>
    </a>
      <p class="site-subtitle" itemprop="description">有些安排是多余的 这片空旷对我有益</p>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>



<nav class="site-nav">
  <ul class="main-menu menu"><li class="menu-item menu-item-home"><a href="/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a></li><li class="menu-item menu-item-moments"><a href="/bb/" rel="section"><i class="fa fa-coffee fa-fw"></i>碎片</a></li><li class="menu-item menu-item-categories"><a href="/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a></li><li class="menu-item menu-item-tags"><a href="/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a></li><li class="menu-item menu-item-archives"><a href="/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a></li><li class="menu-item menu-item-about"><a href="/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a></li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup"><div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off" maxlength="80"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close" role="button">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="search-result-container no-result">
  <div class="search-result-icon">
    <i class="fa fa-spinner fa-pulse fa-5x"></i>
  </div>
</div>

    </div>
  </div>

</div>
        
  
  <div class="toggle sidebar-toggle" role="button">
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
    <span class="toggle-line"></span>
  </div>

  <aside class="sidebar">

    <div class="sidebar-inner sidebar-nav-active sidebar-toc-active">
      <ul class="sidebar-nav">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <div class="sidebar-panel-container">
        <!--noindex-->
        <div class="post-toc-wrap sidebar-panel">
            <div class="post-toc animated"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%9B%AE%E7%9A%84%E5%92%8C%E6%84%8F%E4%B9%89"><span class="nav-number">1.</span> <span class="nav-text">目的和意义</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E9%80%89%E9%A2%98"><span class="nav-number">2.</span> <span class="nav-text">选题</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E7%BB%B4%E6%8A%A4"><span class="nav-number">3.</span> <span class="nav-text">维护</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%88%9B%E5%BB%BA%E4%BB%93%E5%BA%93-Tips"><span class="nav-number">3.1.</span> <span class="nav-text">创建仓库 Tips</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E7%BB%B4%E6%8A%A4%E5%92%8C%E4%B8%80%E4%BA%9B%E8%AE%BE%E5%AE%9A"><span class="nav-number">3.2.</span> <span class="nav-text">维护和一些设定</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#%E6%9C%80%E5%90%8E"><span class="nav-number">4.</span> <span class="nav-text">最后</span></a></li></ol></div>
        </div>
        <!--/noindex-->

        <div class="site-overview-wrap sidebar-panel">
          <div class="site-author site-overview-item animated" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="Kaaaaai"
      src="https://s2.loli.net/2022/03/29/GSJKrCRi4owa9hq.png">
  <p class="site-author-name" itemprop="name">Kaaaaai</p>
  <div class="site-description" itemprop="description">🐨🐨</div>
</div>
<div class="site-state-wrap site-overview-item animated">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
        <a href="/archives/">
          <span class="site-state-item-count">100</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
          <a href="/categories/">
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
          <a href="/tags/">
        <span class="site-state-item-count">66</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="sidebar-button site-overview-item animated">
    <button><i class="fa fa-comment"></i>
      Chat
    </button>
  </div>
  <div class="links-of-author site-overview-item animated">
      <span class="links-of-author-item">
        <a href="https://github.com/Kaaaaai" title="GitHub → https:&#x2F;&#x2F;github.com&#x2F;Kaaaaai" rel="noopener" target="_blank"><i class="fab fa-github fa-fw"></i>GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://stackoverflow.com/users/8342030/kaaaaai" title="StackOverflow → https:&#x2F;&#x2F;stackoverflow.com&#x2F;users&#x2F;8342030&#x2F;kaaaaai" rel="noopener" target="_blank"><i class="fab fa-stack-overflow fa-fw"></i>StackOverflow</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.instagram.com/edisonlllllk" title="Instagram → https:&#x2F;&#x2F;www.instagram.com&#x2F;edisonlllllk" rel="noopener" target="_blank"><i class="fab fa-instagram fa-fw"></i>Instagram</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:root@kaaaaai.cn" title="E-Mail → mailto:root@kaaaaai.cn" rel="noopener" target="_blank"><i class="fa fa-envelope fa-fw"></i>E-Mail</a>
      </span>
  </div>



        </div>
      </div>

      
    <!-- 网易云歌曲 -->
    <iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=421203025&auto=1&height=66"></iframe>
        <div class="back-to-top animated" role="button" aria-label="返回顶部">
          <i class="fa fa-arrow-up"></i>
          <span>0%</span>
        </div>
    </div>
  </aside>
  <div class="sidebar-dimmer"></div>


    </header>

    

<noscript>
  <div class="noscript-warning">Theme NexT works best with JavaScript enabled</div>
</noscript>


    <div class="main-inner post posts-expand">


  


<div class="post-block">
  
  

  <article itemscope itemtype="http://schema.org/Article" class="post-content" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="https://s2.loli.net/2022/03/29/GSJKrCRi4owa9hq.png">
      <meta itemprop="name" content="Kaaaaai">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="壹拾肆">
      <meta itemprop="description" content="🐨🐨">
    </span>

    <span hidden itemprop="post" itemscope itemtype="http://schema.org/CreativeWork">
      <meta itemprop="name" content="是时候维护一个属于自己的开源库了 | 壹拾肆">
      <meta itemprop="description" content="">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          是时候维护一个属于自己的开源库了
        </h1>

        <div class="post-meta-container">
          <div class="post-meta">
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-calendar"></i>
      </span>
      <span class="post-meta-item-text">发表于</span>

      <time title="创建时间：2020-11-21 09:37:05" itemprop="dateCreated datePublished" datetime="2020-11-21T09:37:05+08:00">2020-11-21</time>
    </span>
    <span class="post-meta-item">
      <span class="post-meta-item-icon">
        <i class="far fa-folder"></i>
      </span>
      <span class="post-meta-item-text">分类于</span>
        <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
          <a href="/categories/%E7%AC%94%E8%AE%B0/" itemprop="url" rel="index"><span itemprop="name">笔记</span></a>
        </span>
    </span>

  
    <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv">
      <span class="post-meta-item-icon">
        <i class="far fa-eye"></i>
      </span>
      <span class="post-meta-item-text">阅读次数：</span>
      <span id="busuanzi_value_page_pv"></span>
    </span>
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="far fa-comment"></i>
    </span>
    <span class="post-meta-item-text">Waline：</span>
  
    <a title="waline" href="/its-time-to-build-an-open-source-library.html#waline" itemprop="discussionUrl">
      <span class="post-comments-count waline-comment-count" data-path="/its-time-to-build-an-open-source-library.html" itemprop="commentCount"></span>
    </a>
  </span>
  
  
    <span class="post-meta-break"></span>
    <span class="post-meta-item" title="本文字数">
      <span class="post-meta-item-icon">
        <i class="far fa-file-word"></i>
      </span>
      <span class="post-meta-item-text">本文字数：</span>
      <span>3.1k</span>
    </span>
    <span class="post-meta-item" title="阅读时长">
      <span class="post-meta-item-icon">
        <i class="far fa-clock"></i>
      </span>
      <span class="post-meta-item-text">阅读时长 &asymp;</span>
      <span>3 分钟</span>
    </span>
</div>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">
        <p>使用 GitHub 很久，除了无脑 star、fork 大神们的仓库、输出一些学习代码以外，对于 GitHub 本身的贡献似乎寥寥。<a target="_blank" rel="noopener" href="https://archiveprogram.github.com/arctic-vault/"><strong>Arctic Code Vault Contributor</strong></a> 的勋章我受之有愧。如果你也有和我类似的想法，那么，是时候可以尝试一下维护一个自己的开源库了。</p>
<p>维护一个开源库，听起来很简单，但是真正要开始动手，似乎颇有些千头万绪，无从下手。那让我们来捋一捋，首先我们碰到的第一个问题可能是：我们可以去维护一个怎样的开源库？</p>
<h2 id="目的和意义"><a href="#目的和意义" class="headerlink" title="目的和意义"></a>目的和意义</h2><p>该维护一个怎样的开源库，讨论这个问题之前。我们先把维护开源库这件事当做一个项目来分析，首先我们来思考这个项目的目的和意义——这个思考的结果有利于我们对于这个项目的持续维护，也可以当做一项工作开始前的心理建设。</p>
<p>我们的目的除了上面提到的增加一些对 GitHub 的贡献，我们所选择去维护的开源库类型也可以从另一方面确认我们这个项目的目的，比如如果你打算维护一个你所对应的开发语言的工具类框架，那你们目的就是把这个框架完成，并且好用。</p>
<p>而在这个过程中，你的技能水平有所提升，是附带产生的收获，也是可以在这个阶段当做我们的目的之一。</p>
<p>另外如果你期望你的框架可以满足了一部分人的需求，可以帮助到别人，得到一些 <strong>Star</strong> 和 <strong>Follow</strong>，那么获得他人认可也是作为这个项目的目的之一。</p>
<p>最后，当我们选择去维护一个开源库，这个开源库必然是我们最想去维护的，那这个过程中我们必然是开心和满足的，获得自我满足感也可以当做我们的目的之一，这点也是我认为最重要的。</p>
<p>以上几点，既可以当做目的，从结果上也可以当做我们维护开源库所具备的意义。</p>
<h2 id="选题"><a href="#选题" class="headerlink" title="选题"></a>选题</h2><p>进入正题，我们该维护一个怎样的开源库？对于大神来说，这个问题很简单，基本就是输出一些自制的小工具或者简洁优美的代码轮子，但对于一个还在自己的知识领域里辛苦耕耘的朋友来说，要独立维护一个技术含量比较高的开源库也许会略感吃力，甚至有可能是劝退性的。对于这类心里打鼓的朋友，也许前面干巴巴的文字无法成功完成第一轮的心理建设，也许需要一些更直观的东西来把退堂鼓换成锣鼓，比如：</p>
<ul>
<li><a target="_blank" rel="noopener" href="https://www.zhihu.com/question/23498424/answer/565475152">你在 GitHub 上看到过的最有意思的项目是什么？ - 知乎</a></li>
<li><a target="_blank" rel="noopener" href="https://zhuanlan.zhihu.com/p/58404875">我在 GitHub 上都见过哪些沙雕项目？ - 知乎</a></li>
</ul>
<p>这两个链接里面有许多技术含量不高，但很有趣也有很多 <strong>Star</strong> 的项目，比如这个<a target="_blank" rel="noopener" href="https://github.com/kelseyhightower/nocode">nocode</a><br><img align="center" data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/IJGh1tVqATzZlYL.jpg" width=650px/></p>
<p>没有一行代码的应用程序，看起来像是一个愚人节玩笑。</p>
<blockquote>
<p>Write nothing; deploy nowhere.</p>
</blockquote>
<p>OK，maybe it is the most secure and reliable applications.这个项目在 GitHub 有四万多的 <strong>Star</strong>，颇有几分不着一字，尽得风流的意味。</p>
<p>总之，从以上例子来看，其实我们无需局限于技术，在开源库的类型选择上，我们可以有更开放的选择，总结如下：</p>
<ul>
<li>技术：<a target="_blank" rel="noopener" href="https://github.com/AFNetworking/AFNetworking">AFNetworking</a></li>
<li>某个领域的资讯整合：<a target="_blank" rel="noopener" href="https://github.com/SwiftOldDriver/iOS-Weekly">iOS-Weekly</a></li>
<li>学习资料：<a target="_blank" rel="noopener" href="https://github.com/soapyigu/Swift-30-Projects">Swift-30-Projects</a></li>
<li>同一类资源的合集：<a target="_blank" rel="noopener" href="https://github.com/jaywcjlove/awesome-mac">awesome-mac</a>、<a target="_blank" rel="noopener" href="https://github.com/timmy3131/design-resource">design-resource</a></li>
<li>偏生活向的：<a target="_blank" rel="noopener" href="https://github.com/hoosin/EveryDaySport">EveryDaySport</a>、<a target="_blank" rel="noopener" href="https://github.com/YixuanFranco/YourBoyfriend">YourBoyfriend</a></li>
<li>emmmmm：<a target="_blank" rel="noopener" href="https://github.com/komeiji-satori/Dress">Dress</a></li>
</ul>
<p>确定一个方向后，然后在此基础上从自己擅长或者感兴趣的入手，相信你很快就能找到一个合适的项目。当然别忘了开始前在 GitHub 上检索一下，看看是否有类似的仓库，避免重复造轮子。</p>
<h2 id="维护"><a href="#维护" class="headerlink" title="维护"></a>维护</h2><p>确定好要维护一个怎样的开源库后，接下来就是怎样去维护一个开源库了，即是走一遍创建仓库，拉取部署和维护的流程。——这里默认所有想维护开源库的朋友对 GitHub 的基本操作都熟悉。</p>
<h3 id="创建仓库-Tips"><a href="#创建仓库-Tips" class="headerlink" title="创建仓库 Tips"></a>创建仓库 Tips</h3><p>创建仓库这里有个小 Tips，是公司同事分享的，就是一个比较正式的开源库，通常会挂在一个组织底下，比如：<br><img align="center" data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/9FHA4eQsfUqkWYX.png" width=650px/><br>比如：<br><img align="center" data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/F39zC7M2nTcXGyP.png" width=650px/><br>再比如<br><img align="center" data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/b4ga6fzWIvkVoce.png" width=650px/><br>由以上例子可见，挂在组织底下的项目会比挂在个人底下的项目看起来更会正式。哪怕我们是个人维护的，但让他看起来正式一点也没什么错误。另外在被搜索和在 url 路径展示上也相对会工整一点。<br><img align="center" data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/ezD8NbqloGFipHX.png" width=650px/></p>
<h3 id="维护和一些设定"><a href="#维护和一些设定" class="headerlink" title="维护和一些设定"></a>维护和一些设定</h3><p>创建完一个仓库以后，拉取部署等常规操作略过不提，说说维护。步入正轨的维护，其实就是持续的 push 就好，根据仓库类型不同，有的也许是周期需要维护的，有的也许上线已接近完成，需要做的只是抓虫和偶尔更新。这个时候需要注意：</p>
<ol>
<li>对项目保持一定的关注，给自己固定一个周期性的时间检查项目，以防止时间断层导致项目失去维护。</li>
<li>每次 commit 的描述，清晰直观的提交历史可以让人对你的表述能力有大概了解，也方便给潜在的，想要一起维护的开发者一个直观的项目过往，有利于增加与你一起协作维护的吸引力。</li>
<li>项目结构的条理性，原因同上。</li>
</ol>
<p>除了步入正轨的维护，在创建时，还有项目本身的一些设定也很重要：<br><img data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/qKgJbv1x2cGzk7e.png" alt="qKgJbv1x2cGzk7e"></p>
<ul>
<li>项目 logo</li>
<li>readme 文件的书写</li>
<li>项目描述</li>
<li>开源声明</li>
</ul>
<p>项目 logo 如果动手能力强的朋友可以考虑自己设计一下，网上也有在线工具可以用符号排列组合生成属于自己的 logo。</p>
<p>readme 文件作为一个项目的头脸，描述清晰直观的重要性远远超过上述提到的 commint，需要注意的主要有内容排版，头部和尾部信息。</p>
<p>细心的朋友可能注意到许多项目的 readme 文件的头部会有类似于这种<a target="_blank" rel="noopener" href="https://awesome-online-efficiency.github.io/Awesome-Online-Efficiency/"><img data-src="/images/loading-style-3.gif" data-original="https://img.shields.io/static/v1?label=&labelColor=505050&message=website&color=%230076D6&style=flat&logo=google-chrome&logoColor=%230076D6" alt="website"/></a>展示仓库属性信息的小标签，这种标签可以使用 <a target="_blank" rel="noopener" href="https://shields.io/">Shields.io</a> 这个网站来制作。</p>
<p>以我的仓库为例，在网站首页填入仓库地址，点击 <strong>Suggest badges</strong> 会自动生成几个标签，不同的标签代表着不同的含义。<br><img data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/pcHKt3e9LRv1jdV.png" alt="pcHKt3e9LRv1jdV"></p>
<p>如果想展示更多的内容，可以上拉网页自己定制。</p>
<p>readme 的底部信息，没有标准，有的仓库会把作者的个人信息挂上，有的会列出贡献者名单，也有的会把自己的收款二维码贴上，供人打赏。全凭个人喜欢。</p>
<p>关于仓库 <strong>About</strong> 的描述，力求简洁，明朗，最好一句话能说清楚是干嘛的。而一个有网站可以浏览的仓库体验也会相对好点，这方面使用 GitHub 提供的服务——GitHub Pages 已然可以满足。实现起来有两种方式：</p>
<ol>
<li>可以在仓库设置界面点击 <code>Change Theme</code>，在进去的二级页面选择好主题后，GitHub 会自动帮你生成一个网站分支，自动拉取你主分支的内容更新。<br> <img data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/s6yAmwq84ZRFkoz.png" alt="s6yAmwq84ZRFkoz"></li>
<li>如果不喜欢产生多余分支，有强迫症的朋友也可以尝试在仓库主路径底下增加 <code>_config.yml</code> 文件，在里面添加主题配置： <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">theme: jekyll-theme-cayman</span><br></pre></td></tr></table></figure>
 并在设置中选择，通过主分支来构建网站，即可生成仓库网站。<br> <img data-src="/images/loading-style-3.gif" data-original="https://i.loli.net/2020/11/22/Mmc8NQbY4g5Tw3q.png" alt="Mmc8NQbY4g5Tw3q"></li>
</ol>
<p>给仓库设置标签有利于检索，比如我给我的仓库设置了一个 <code>awesome</code> 的标签，那么如果有人搜索相关字段，或者直接在 <a target="_blank" rel="noopener" href="https://github.com/topics/awesome">Awesome Lists</a> 这个列表里找，会有相对较高的曝光率。</p>
<p>关于版权声明，如果在创建仓库时勾选了生成版权声明的文件，创建后会自动生成该文件。如果没有后面自己加也可以，添加后侧边栏会自动生成版权声明的描述。我这里选择的是 CC0-1.0 的版本。关于不同版本声明的区别会在<del>后续文章中更新</del>——本来想更新一篇关于不同版本开源声明的区别的文章，在网上检索资料时发现一个开源库可以帮助开发者选择不同的软件开源声明：<a target="_blank" rel="noopener" href="https://choosealicense.com/">Choose a License</a>。</p>
<h2 id="最后"><a href="#最后" class="headerlink" title="最后"></a>最后</h2><p>要维护好一个开源库需要做的事情远比上面列举的还要多，只是对于一个刚开始维护一个开源库的新手来说，不至于劝退，这些内容已经足够。</p>
<p>而在步入正轨以后，你可能需要回答 <code>Issues</code> 里提出来的各种意想不到的问题，也可能要甄别 <code>Pull requests</code> 下的提交是否有益，利用好 GitHub 提供的额外功能 <code>Actions</code>、<code>Projects</code> 则可以大大提高维护和协作的效率。另外你还可以在 <code>Insights</code> 看到自己仓库的各种统计信息，仓库的贡献曲线图，浏览次数，被下载次数等等。</p>
<p>最后，无论你的开源库是否因为代码优美而获得许多 <strong>Star</strong>，还是持续维护仍无人问津，都祝你好运。最后分享一句孔子的一段话，也做自我勉励：</p>
<blockquote>
<p>芝兰生于空谷，不以无人而不芳。</p>
</blockquote>

    </div>

    
    
    

    <footer class="post-footer">
          <div class="reward-container">
  <div></div>
  <button>
    请喝咖啡
  </button>
  <div class="post-reward">
      <div>
        <img src="/images/loading-style-3.gif" data-original="https://s2.loli.net/2022/07/02/Gce8a5QAqrZ3X9R.gif" alt="Kaaaaai 微信">
        <span>微信</span>
      </div>

  </div>
</div>

          

<div class="post-copyright">
<ul>
  <li class="post-copyright-author">
      <strong>本文作者： </strong>Kaaaaai
  </li>
  <li class="post-copyright-link">
      <strong>本文链接：</strong>
      <a href="https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html" title="是时候维护一个属于自己的开源库了">https://www.kaaaaai.cn/its-time-to-build-an-open-source-library.html</a>
  </li>
  <li class="post-copyright-license">
    <strong>版权声明： </strong>本博客所有文章除特别声明外，均采用 <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" rel="noopener" target="_blank"><i class="fab fa-fw fa-creative-commons"></i>BY-NC-SA</a> 许可协议。转载请注明出处！
  </li>
</ul>
</div>

          <div class="post-tags">
              <a href="/tags/EXP/" rel="tag"><i class="fa fa-tag"></i> EXP</a>
              <a href="/tags/OpenSource/" rel="tag"><i class="fa fa-tag"></i> OpenSource</a>
              <a href="/tags/GitHub/" rel="tag"><i class="fa fa-tag"></i> GitHub</a>
          </div>

        

          <div class="post-nav">
            <div class="post-nav-item">
                <a href="/ios-douban-open-source-license-mentioned-in-the-library.html" rel="prev" title="iOS 端豆瓣开源许可提到的库">
                  <i class="fa fa-chevron-left"></i> iOS 端豆瓣开源许可提到的库
                </a>
            </div>
            <div class="post-nav-item">
                <a href="/translation-why-use-dependency-injection.html" rel="next" title="翻译：Why use dependency injection">
                  翻译：Why use dependency injection <i class="fa fa-chevron-right"></i>
                </a>
            </div>
          </div>
    </footer>
  </article>
</div>






    <div class="comments" id="waline"></div>
</div>
  </main>

  <footer class="footer">
    <div class="footer-inner">


<div class="copyright">
  &copy; 
  <span itemprop="copyrightYear">2024</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Kaaaaai</span>
</div>
<div class="wordcount">
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-chart-line"></i>
    </span>
    <span title="站点总字数">234k</span>
  </span>
  <span class="post-meta-item">
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
    <span title="站点阅读时长">3:33</span>
  </span>
</div>
<div class="busuanzi-count">
    <span class="post-meta-item" id="busuanzi_container_site_uv">
      <span class="post-meta-item-icon">
        <i class="fa fa-user"></i>
      </span>
      <span class="site-uv" title="总访客量">
        <span id="busuanzi_value_site_uv"></span>
      </span>
    </span>
    <span class="post-meta-item" id="busuanzi_container_site_pv">
      <span class="post-meta-item-icon">
        <i class="fa fa-eye"></i>
      </span>
      <span class="site-pv" title="总访问量">
        <span id="busuanzi_value_site_pv"></span>
      </span>
    </span>
</div>
  <!-- time -->
  <div id="show-time">
    <span id="span_dt_dt"></span>
  </div>
  <script>
      function show_date_time() {
        window.setTimeout("show_date_time()", 1000);
        BirthDay = new Date("6/23/2017 19:37:01");
        today = new Date();
        //总时间
        timeold = (today.getTime() - BirthDay.getTime());
        sectimeold = timeold / 1000
        secondsold = Math.floor(sectimeold);
        msPerDay = 24 * 60 * 60 * 1000
        e_daysold = timeold / msPerDay
        daysold = Math.floor(e_daysold);
        e_hrsold = (e_daysold - daysold) * 24;
        hrsold = Math.floor(e_hrsold);
        e_minsold = (e_hrsold - hrsold) * 60;
        minsold = Math.floor((e_hrsold - hrsold) * 60);
        seconds = Math.floor((e_minsold - minsold) * 60);
        span_dt_dt.innerHTML = "已存活 " + daysold + " 天 " + hrsold + " 小时 " + minsold + " 分 " + seconds + " 秒";
    }
    show_date_time();
  </script>

    </div>
  </footer>

  
  <script src="https://cdnjs.cloudflare.com/ajax/libs/animejs/3.2.1/anime.min.js" integrity="sha256-XL2inqUJaslATFnHdJOi9GfQ60on8Wx1C2H8DYiN1xY=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/next-theme-pjax/0.5.0/pjax.min.js" integrity="sha256-3NkoLDrmHLTYj7csHIZSr0MHAFTXth7Ua/DDt4MRUAg=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" integrity="sha256-/xUj+3OJU5yExlq6GSYGSHk7tPXikynS7ogEvDej/m4=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js" integrity="sha256-yt2kYMy0w8AbtF89WXb2P1rfjcP/HTHLT7097U8Y5b8=" crossorigin="anonymous"></script>
  <script src="https://cdnjs.cloudflare.com/ajax/libs/lozad.js/1.16.0/lozad.min.js" integrity="sha256-mOFREFhqmHeQbXpK2lp4nA3qooVgACfh88fpJftLBbc=" crossorigin="anonymous"></script>
<script src="/js/comments.js"></script><script src="/js/utils.js"></script><script src="/js/motion.js"></script><script src="/js/next-boot.js"></script><script src="/js/pjax.js"></script>

  
<script src="https://cdnjs.cloudflare.com/ajax/libs/hexo-generator-searchdb/1.4.0/search.js" integrity="sha256-vXZMYLEqsROAXkEw93GGIvaB2ab+QW6w3+1ahD9nXXA=" crossorigin="anonymous"></script>
<script src="/js/third-party/search/local-search.js"></script>
<script class="next-config" data-name="chatra" type="application/json">{"enable":true,"async":true,"id":"QXLRxXcsfrRJR2KTG"}</script>
<script src="/js/third-party/chat/chatra.js"></script>
<script async src="https://call.chatra.io/chatra.js"></script>



  <script src="/js/third-party/fancybox.js"></script>

  <script src="/js/third-party/pace.js"></script>

  
  <script data-pjax async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>




<script class="next-config" data-name="waline" type="application/json">{"lang":"zh-cn","enable":true,"serverURL":"https://waline-server-kaaaaai.vercel.app","cssUrl":"https://unpkg.com/@waline/client@v2/dist/waline.css","commentCount":true,"pageview":false,"placeholder":"请文明评论呀","avatar":"mm","meta":["nick","mail","link"],"pageSize":10,"visitor":false,"comment_count":true,"requiredFields":[],"libUrl":"//unpkg.com/@waline/client@v2/dist/waline.js","el":"#waline","comment":true,"path":"/its-time-to-build-an-open-source-library.html"}</script>
<link rel="stylesheet" href="https://unpkg.com/@waline/client@v2/dist/waline.css">
<script>
document.addEventListener('page:loaded', () => {
  NexT.utils.loadComments(CONFIG.waline.el).then(() =>
    NexT.utils.getScript(CONFIG.waline.libUrl, { condition: window.Waline })
  ).then(() => 
    Waline.init(Object.assign({}, CONFIG.waline,{ el: document.querySelector(CONFIG.waline.el) }))
  );
});
</script>


        <style>
            [bg-lazy] {
                background-image: none !important;
                background-color: #eee !important;
            }
        </style>
        <script>
            window.imageLazyLoadSetting = {
                isSPA: true,
                preloadRatio: 1,
                processImages: null,
            };
        </script><script>window.addEventListener("load",function(){var t=/\.(gif|jpg|jpeg|tiff|png)$/i,r=/^data:image\/[a-z]+;base64,/;Array.prototype.slice.call(document.querySelectorAll("img[data-original]")).forEach(function(a){var e=a.parentNode;"A"===e.tagName&&(e.href.match(t)||e.href.match(r))&&(e.href=a.dataset.original)})});</script><script>!function(r){r.imageLazyLoadSetting.processImages=t;var a=r.imageLazyLoadSetting.isSPA,n=r.imageLazyLoadSetting.preloadRatio||1,d=o();function o(){var t=Array.prototype.slice.call(document.querySelectorAll("img[data-original]")),e=Array.prototype.slice.call(document.querySelectorAll("[bg-lazy]"));return t.concat(e)}function t(t){(a||t)&&(d=o());for(var e,i=0;i<d.length;i++)0<=(e=(e=d[i]).getBoundingClientRect()).bottom&&0<=e.left&&e.top<=(r.innerHeight*n||document.documentElement.clientHeight*n)&&function(){var t,e,a,n,o=d[i];e=function(){d=d.filter(function(t){return o!==t}),r.imageLazyLoadSetting.onImageLoaded&&r.imageLazyLoadSetting.onImageLoaded(o)},(t=o).dataset.loaded||(t.hasAttribute("bg-lazy")?(t.removeAttribute("bg-lazy"),e&&e()):(a=new Image,n=t.getAttribute("data-original"),a.onload=function(){t.src=n,t.removeAttribute("data-original"),t.setAttribute("data-loaded",!0),e&&e()},a.onerror=function(){t.removeAttribute("data-original"),t.setAttribute("data-loaded",!1),t.src=n},t.src!==n&&(a.src=n)))}()}function e(){clearTimeout(t.tId),t.tId=setTimeout(t,500)}t(),document.addEventListener("scroll",e),r.addEventListener("resize",e),r.addEventListener("orientationchange",e)}(this);</script></body>
</html>
